from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time

# 根据url进行断言
driver = webdriver.Chrome()
driver.implicitly_wait(10)
driver.get('http://www.baidu.com')
search = driver.find_element_by_id('kw')
search.send_keys('python')
search.send_keys(Keys.ENTER)
time.sleep(3)
# 获取网页的url
print(driver.current_url)
